package lumis.portal.servicecontainer;

import java.util.Enumeration;
import java.util.Vector;

import javax.portlet.PortletMode;
import javax.portlet.WindowState;

import lumis.portal.PortalContext;

/**
 * PortalContext implementation.
 * @since 5.5.0
 * @version $Revision: 11180 $ $Date: 2009-12-04 18:13:02 -0200 (Fri, 04 Dec 2009) $
 */
class PortalContextImpl implements javax.portlet.PortalContext
{
	private static final Vector<PortletMode> SUPPORTED_PORTLET_MODES = new Vector<PortletMode>(3);
	private static final Vector<WindowState> SUPPORTED_WINDOW_STATES = new Vector<WindowState>(3);
	static
	{
		SUPPORTED_PORTLET_MODES.add(PortletMode.VIEW);
		SUPPORTED_PORTLET_MODES.add(PortletMode.EDIT);
		SUPPORTED_PORTLET_MODES.add(PortletMode.HELP);
		SUPPORTED_WINDOW_STATES.add(WindowState.NORMAL);
		SUPPORTED_WINDOW_STATES.add(WindowState.MAXIMIZED);
		SUPPORTED_WINDOW_STATES.add(WindowState.MINIMIZED);
	}
	
	private static javax.portlet.PortalContext INSTANCE = new PortalContextImpl();
	
	private PortalContextImpl()
	{
	}
	
	/**
	 * Returns the portal context instance.
	 * @return the portal context instance.
	 * @since 5.5.0
	 */
	public static javax.portlet.PortalContext getInstance()
	{
		return INSTANCE;
	}
	
	public String getPortalInfo()
	{
		return PortalContext.getPortalInfo();
	}

	public String getProperty(String propertyName)
	{
		// TODO Auto-generated method stub
		return null;
	}

	public Enumeration<String> getPropertyNames()
	{
		// TODO Auto-generated method stub
		return null;
	}

	public Enumeration<PortletMode> getSupportedPortletModes()
	{
		return SUPPORTED_PORTLET_MODES.elements();
	}

	public Enumeration<WindowState> getSupportedWindowStates()
	{
		return SUPPORTED_WINDOW_STATES.elements();
	}
}
